﻿<?php
error_reporting(0);
define('IN_QY',true);
session_start();
require("include/common.inc.php");
define('SCRIPT','ad_list');
$infoid=trim($_GET['fid']);
if($infoid==""){
      echo "<script type='text/javascript'>location.href='mlogin.php';</script>";
      exit;
}
if(!$_COOKIE['userid']){
      echo "<script type='text/javascript'>location.href='yaoq_tz.php?uid=kdhgisughteotuertuertryrtuerterywrurtuwurtuwueryrturtuwuttwukdhgisughteotuertuertryrtuerterywrurtuwurtuwueryrturtuwuttwu&fid=".$infoid."';</script>";
      exit;
}
$sqlu = "select * from tbl_user where id=".$_COOKIE['userid'];
$queryu=mysql_query($sqlu);
$rowu=mysql_fetch_array($queryu);
$jifen = $rowu['jifen'];
$yuee = $rowu['yuee'];
$xyf = $rowu['xyf'];
$vip = $rowu['vip'];
$touxiang = $rowu['username'];
$sqla = "select count(*) as cc from tbl_user where shibie='".$_COOKIE['username']."'";
$querya=mysql_query($sqla);
$rowa=mysql_fetch_array($querya);
$s = $rowa['cc'];
//
include 'phpqrcode.php';    
$value = 'http://www.goodshare.com.cn/wap/mmregister.php?yqr='.$_COOKIE['username']; //二维码内容   
$errorCorrectionLevel = 'L';//容错级别   
$matrixPointSize = 6;//生成图片大小   
//生成二维码图片   
QRcode::png($value, 'sao/'.$_COOKIE['userid'].'.png', $errorCorrectionLevel, $matrixPointSize, 2);   
$logo = $touxiang;//准备好的logo图片 
  
$QR = 'sao/'.$_COOKIE['userid'].'.png';//已经生成的原始二维码图   

if ($logo !== FALSE) {   
    $QR = imagecreatefromstring(file_get_contents($QR));   
    $logo = imagecreatefromstring(file_get_contents($logo));   
    $QR_width = imagesx($QR);//二维码图片宽度   
    $QR_height = imagesy($QR);//二维码图片高度   
    $logo_width = imagesx($logo);//logo图片宽度   
    $logo_height = imagesy($logo);//logo图片高度   
    $logo_qr_width = $QR_width / 5;   
    $scale = $logo_width/$logo_qr_width;   
    $logo_qr_height = $logo_height/$scale;   
    $from_width = ($QR_width - $logo_qr_width) / 2;   
    //重新组合图片并调整大小   
    imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width,   
    $logo_qr_height, $logo_width, $logo_height);   
}   
//输出图片 
$zpp='sao/'.$_COOKIE['userid'].'.png';  
imagepng($QR, $zpp);
//查成交量
$sqlb = "select count(*) as dd from tbl_spp where content='该商品已卖' AND userid='".$_COOKIE['username']."'";
$queryb=mysql_query($sqlb);
$rowb=mysql_fetch_array($queryb);
$chengjiaoliang = $rowb['dd'];  //成交量
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="apple-touch-fullscreen" content="yes">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="format-detection" content="telephone=no">
	<meta name="keywords" content="注册会员邀请好友">
	<meta name="description" content="注册会员邀请好友">
	<meta name="author" content="AUI, a-ui.com">
	<title><?php echo mb_substr($_COOKIE['shuyu'],0,11);?>.邀请你加入众晒网大家庭-众晒网</title>
	<link rel="icon" type="image/x-icon" href="favicon.ico">
	<link href="iTunesArtwork@2x.png" sizes="114x114" rel="apple-touch-icon-precomposed">
	<link rel="stylesheet" type="text/css" href="/ui/yaoqing/css/base.css">
	<link rel="stylesheet" type="text/css" href="/ui/yaoqing/css/home.css">
	<style>
		.shade-mask{
			position: fixed;
			z-index: 999;
			left: 0;
			top: 0;
			right: 0;
			background: rgba(0, 0, 0, 0.7);
			display:block;
			width: 100%;
			height: 100%;
			text-align: center;
		}
		.shade-login{
			left: 0;
			top: 40%;
			z-index: 9999;
			display: block;
			width: 80%;
			margin: 0 10%;
			text-align: center;
			position: fixed !important;
			background-size: cover;
			background: rgba(255, 255, 255, 0.9);
			padding: 30px;
			height:140px;
		}
		.shade-login h3{
			padding-bottom:20px;
			font-size:16px;
		}
		.shade-login a{
			background:#d9464f;
			width:150px;
			height:34px;
			line-height:34px;
			border-radius:5px;
			display:inline-block;
			color:#fff;
			font-size:14px;
			text-align:center;
		}
	</style>
</head>
<body>
<header class="ui-header ui-header-positive ui-border-b">
	<i class="ui-icon-return" onclick="history.back()"></i>
	<h1><?php echo mb_substr($_COOKIE['shuyu'],0,11);?>.邀请好友页面</h1>
</header>
<div class="in-body">
	<div id="in-self" class="in-self"></div>
	<!-- header begin -->
	<header id="header">
		<div class="in-header">
			<img src="<?=$touxiang?>" alt="">
		</div>
		<div class="in-button-box">
			<div class="in-button" id="myBtn">
				<img src="/ui/yaoqing/picture/icon-btn.png" alt="">
			</div>
		</div>
		<!-- pop begin 	
		<div class="in-code" onclick="Ceng()">
			<img src="picture/ewm.png" alt="">
		</div>
	
		
		<div id="ceng" class="in-cen"></div>
		<div id="close" class="in-pop">
			<div class="in-self-info">
				<a onclick="closeCeng()">
					<img src="picture/icon-close.png" alt="">
				</a>
				<div class="in-pop-text">
					<p>您的专属邀请二维码</p>
					<p>长按可保存</p>
				</div>
			</div>
		</div>
		-- pop end -->
		<!-- share  begin-->
		<div id="myModal" class="modal ">
			<!-- 弹窗内容 -->
			<div class="modal-content ">
				<div class="modal-header">
					<span class="close"></span>
				</div>
				<div class="gb_resLay">
					<div class="gb_res_t">
						<span>扫码或者保存二维码到本地</span>
						<i></i>
					</div>
					<div class="bdsharebuttonbox">
						<ul class="gb_resItms clearfix">
                     				<div class="example">
                <img  style="width: 100px;height:100px;margin-left: 35%;" src="<?=$zpp?>" alt="">

				</div>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<!-- share  end-->
	</header>
	<!-- header end -->
	<!-- content begin -->
	<section id="content">
		<div class="in-content">
			<div class="in-content-line"></div>
			<div class="in-content-box">
				<div class="in-content-title">
					<h2>- 我的邀请 -</h2>
					<div class="in-line-left">
						<img src="/ui/yaoqing/picture/icon-line.png" alt="">
					</div>
					<div class="in-line-right">
						<img src="/ui/yaoqing/picture/icon-line.png" alt="">
					</div>
				</div>
				<div class="in-content-links">
					<a href="javascript:;">
						<div class="in-content-hd">
							<img src="<?=$touxiang?>" alt="">
						</div>
						<div class="in-content-bd">
							<p><?php echo mb_substr($_COOKIE['shuyu'],0,11);?></p>
						</div>
						<div class="in-content-ft">
							<p>
								已邀请 <em><?=$s?></em>
								人
							</p>
						</div>
					</a>
					<div class="in-line-left in-content-left">
						<img src="/ui/yaoqing/picture/icon-line.png" alt="">
					</div>
					<div class="in-line-right in-content-right">
						<img src="/ui/yaoqing/picture/icon-line.png" alt="">
					</div>
				</div>
				<div class="in-content-fellow">

									<?
            $sql = "select * from tbl_user where shibie='".$_COOKIE['username']."' ORDER by id DESC limit 10" ;
			$query=mysql_query($sql);
			while($row=mysql_fetch_array($query))
			{
				
			$telll = substr($row['userid'], 0, 3).'****'.substr($row['userid'], 7);	
				
			?>
				
				
					<div class="in-fellow-well">
					<!--
						<div class="in-content-tx">
							<img src="/ui/yaoqing/picture/nub2.png" alt="">
						</div>
					-->	
						<div class="in-content-hd">
							<img src="<?=$row['username']?>" alt="">
							<div class="in-yellow-crown"></div>
						</div>
						<div class="in-content-bd yellow">
							<p><?=$row['shuyu']?></p>
						</div>
						<div class="in-content-ft">
							<p>
								<?=$telll?>
							</p>
						</div>
					</div>
					
			 <?php } ?>		

				</div>
			</div>
			<div class="in-links">
				<a href="huodong.html">查看活动规则</a>
			</div>
		</div>
	</section>
	<!-- content end -->
</div>

<div id="qrcodeDiv">
     <img id="logoImg" style="display: none;" src="1.jpg" alt="">
   
</div>
<script src="/ui/yaoqing/js/in-jquery.js" type="text/javascript"></script>
<script src="/ui/yaoqing/js/jquery.min.js"></script>
<script type="text/javascript" src="/ui/yaoqing/js/qrcode.min.js"></script>

<script type="text/javascript">

	//二维码弹窗
    function Ceng() {
        document.getElementById('ceng').style.display = 'block';
        document.getElementById('close').style.display = 'block';
        return false;
    }
    function closeCeng() {
        document.getElementById('ceng').style.display = 'none';
        document.getElementById('close').style.display = 'none';
        return false;

    }

    // 获取弹窗
    var modal = document.getElementById('myModal');

    // 打开弹窗的按钮对象

    var btn = document.getElementById("myBtn");

    // 获取 <span> 元素，用于关闭弹窗 that closes the modal
    var span = document.getElementsByClassName("close")[0];

    // 点击按钮打开弹窗
    btn.onclick = function() {
        modal.style.display = "block";
    }

    // 点击 <span> (x), 关闭弹窗
    span.onclick = function() {
        modal.style.display = "none";
    }

    // 在用户点击其他地方时，关闭弹窗
    window.onclick = function(event) {
        if (event.target == modal) {
            modal.style.display = "none";
        }
    }


</script>
	 <!-- 这是美洽的嵌入代码 -->
<script type='text/javascript'>
    (function(m, ei, q, i, a, j, s) {
        m[i] = m[i] || function() {
            (m[i].a = m[i].a || []).push(arguments)
        };
        j = ei.createElement(q),
            s = ei.getElementsByTagName(q)[0];
        j.async = true;
        j.charset = 'UTF-8';
        j.src = 'https://static.meiqia.com/dist/meiqia.js?_=t';
        s.parentNode.insertBefore(j, s);
    })(window, document, 'script', '_MEIQIA');
    _MEIQIA('entId', '65407');

    // 在这里开启无按钮模式（常规情况下，需要紧跟在美洽嵌入代码之后）
   // _MEIQIA('withoutBtn');
</script>
<script type='text/javascript'>
    // 当你使用了「手动初始化」时，就可以在自己的逻辑中选择合适的时机调用 withoutBtn
    // 只要是在美洽初始化之前，就可以被正确执行
   // _MEIQIA('withoutBtn');
   // _MEIQIA('init');
</script>
<!-- 这是美洽的嵌入代码 -->

<!-- 这是统计的嵌入代码 -->
				<script>
var _mtac = {};
(function() {
    var mta = document.createElement("script");
    mta.src = "http://pingjs.qq.com/h5/stats.js?v2.0.2";
    mta.setAttribute("name", "MTAH5");
    mta.setAttribute("sid", "500475478");
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(mta, s);
})();
</script>
<!-- 这是统计的嵌入代码 -->
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?34f3a18911602e0c3011b48c72e38bb7";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
